# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Thomas Baechler <thomas@archlinux.org>
# Contributor: Jaroslaw Swierczynski <swiergot@juvepoland.com>
# Contributor: Michal Hybner <dta081@gmail.com>
# Contributor: Andrea Scarpino <andrea@archlinux.org>

pkgbase=firefox-i18n
pkgver=92.0.1
pkgrel=1
pkgdesc="Language pack for Firefox"
arch=(any)
license=(MPL GPL LGPL)
url="https://www.mozilla.org/firefox/"

_languages=(
  'ach    "Acholi"'
  'af     "Afrikaans"'
  'an     "Aragonese"'
  'ar     "Arabic"'
  'ast    "Asturian"'
  'az     "Azerbaijani"'
  'be     "Belarusian"'
  'bg     "Bulgarian"'
  'bn     "Bengali"'
  'br     "Breton"'
  'bs     "Bosnian"'
  'ca-valencia "Catalan (Valencian)"'
  'ca     "Catalan"'
  'cak    "Maya Kaqchikel"'
  'cs     "Czech"'
  'cy     "Welsh"'
  'da     "Danish"'
  'de     "German"'
  'dsb    "Lower Sorbian"'
  'el     "Greek"'
  'en-CA  "English (Canadian)"'
  'en-GB  "English (British)"'
  'en-US  "English (US)"'
  'eo     "Esperanto"'
  'es-AR  "Spanish (Argentina)"'
  'es-CL  "Spanish (Chile)"'
  'es-ES  "Spanish (Spain)"'
  'es-MX  "Spanish (Mexico)"'
  'et     "Estonian"'
  'eu     "Basque"'
  'fa     "Persian"'
  'ff     "Fulah"'
  'fi     "Finnish"'
  'fr     "French"'
  'fy-NL  "Frisian"'
  'ga-IE  "Irish"'
  'gd     "Gaelic (Scotland)"'
  'gl     "Galician"'
  'gn     "Guarani"'
  'gu-IN  "Gujarati (India)"'
  'he     "Hebrew"'
  'hi-IN  "Hindi (India)"'
  'hr     "Croatian"'
  'hsb    "Upper Sorbian"'
  'hu     "Hungarian"'
  'hy-AM  "Armenian"'
  'ia     "Interlingua"'
  'id     "Indonesian"'
  'is     "Icelandic"'
  'it     "Italian"'
  'ja     "Japanese"'
  'ka     "Georgian"'
  'kab    "Kabyle"'
  'kk     "Kazakh"'
  'km     "Khmer"'
  'kn     "Kannada"'
  'ko     "Korean"'
  'lij    "Ligurian"'
  'lt     "Lithuanian"'
  'lv     "Latvian"'
  'mk     "Macedonian"'
  'mr     "Marathi"'
  'ms     "Malay"'
  'my     "Burmese"'
  'nb-NO  "Norwegian (Bokmål)"'
  'ne-NP  "Nepali"'
  'nl     "Dutch"'
  'nn-NO  "Norwegian (Nynorsk)"'
  'oc     "Occitan"'
  'pa-IN  "Punjabi (India)"'
  'pl     "Polish"'
  'pt-BR  "Portuguese (Brazilian)"'
  'pt-PT  "Portuguese (Portugal)"'
  'rm     "Romansh"'
  'ro     "Romanian"'
  'ru     "Russian"'
  'si     "Sinhala"'
  'sk     "Slovak"'
  'sl     "Slovenian"'
  'son    "Songhai"'
  'sq     "Albanian"'
  'sr     "Serbian"'
  'sv-SE  "Swedish"'
  'ta     "Tamil"'
  'te     "Telugu"'
  'th     "Thai"'
  'tl     "Tagalog"'
  'tr     "Turkish"'
  'trs    "Chicahuaxtla Triqui"'
  'uk     "Ukrainian"'
  'ur     "Urdu"'
  'uz     "Uzbek"'
  'vi     "Vietnamese"'
  'xh     "Xhosa"'
  'zh-CN  "Chinese (Simplified)"'
  'zh-TW  "Chinese (Traditional)"'
)

pkgname=()
source=()
_url=https://ftp.mozilla.org/pub/firefox/releases/$pkgver/linux-x86_64/xpi

for _lang in "${_languages[@]}"; do
  _locale=${_lang%% *}
  _pkgname=firefox-i18n-${_locale,,}

  pkgname+=($_pkgname)
  source+=("firefox-i18n-$pkgver-$_locale.xpi::$_url/$_locale.xpi")
  eval "package_$_pkgname() {
    _package $_lang
  }"
done

# Don't extract anything
noextract=(${source[@]%%::*})

_package() {
  pkgdesc="$2 language pack for Firefox"
  depends=("firefox>=$pkgver")
  install -Dm644 firefox-i18n-$pkgver-$1.xpi \
    "$pkgdir/usr/lib/firefox/browser/extensions/langpack-$1@firefox.mozilla.org.xpi"
}

sha256sums=('eb5ebe23981299f438250a6025e712eea2e64af93c0ed3f4e0ea6b8ac0c229ab'
            '66245d33b3f1b11f4df729775dd4dc1490608743168184c3f38afb3842db6fd3'
            '1f5c00da4ce79a83adda239c1a69e107b0eab7779bf57ccd12b610d946e6e3e9'
            'c3d954a43702c8cd80259faf6a46b8bff31f23c9042d92967f131750cc10c30f'
            'be80d9bd97c1762745f09febdd916acce1e2830b163af880cc0a9650d727ba23'
            '4cdbe6a4d41c1ba104a25a503f5d94dd1bca97759e6e02ad5c4004281e946a9e'
            'd975bfd48646f730fb9e6d6a6499ac035510ad20470f24649b9599673b25a506'
            '2954564bf4b395acb01b16356504d98791d40c7a1ee6a2bc2d79336867c6c6d3'
            '7d8ea0bbe422d9cffb6e88f88882c5227a027067df9105b529e8476812f1604d'
            '76385588c1b49cb5cfb1eced66342f2dfc8c24ad52f3439c576af78c4b2a495c'
            'c66b0ff5e78262e9c17d2349f94d17065bc7cb20e56d4437453e783f9fe04da1'
            '50f2791e724dbfd7ab9759908ca65f7ceb60a6cb3196068cf9db8019a8d7c613'
            '8d76cfa795b9d59f13d870b69423fd85faa6b159d30faffcc27f7a1a88a7fa89'
            'd82e824651b48934f907192db701fad767735df6b2679f62cccd8b55545b3dbc'
            'ceda5141ed0d27823f3fa2605465f25a4a069da4ae4ff2b173efbdc380f00050'
            'b082ebac63565dec4c53f17e60d2adc4893eaf6db71976b962579a4ba25aab4e'
            'e88f66dd132ca56c54ebc42558a57698e2ed18a1af96d4858ddabf2d963271b4'
            'e0448f403e4698596260018a385e0fa1fa63058e962fd8ba1cf602526cd59878'
            'a6d2fa0e9a95901fb63542f2a859d9e659aeca19465201e4f4627b74c3a0cf0b'
            'acc341170e413f3648f81b343dcd49501a7f066d9139fbec66c34ab1e11c84a8'
            '4a3956b4db2054f1c29a21281dfd0ab5307dce9ffa9672687c7819f6bd7f6b6c'
            '0fb2ca353209c8b0c56260c27649190049dd4ec62945d7ca2c2898dbe64419b2'
            'e5eb3ce1011913ae411f83043efe9d2c6a6a2c65f7f856bb2be9457c6ae4609e'
            'e26ceadafa1aa0e6fc9314d176831437d64c1a951c117d72bb1a99e797000d72'
            '2e9682c9350d7a170882e150be45071ba5ba4fe9fe41eb6a23df8362731d0c72'
            '3580caa3f1952918d67ff02a1482db38fe05b5ce1b8c58bb33976ff3a8db75a6'
            'e1fb31ade591a49995a49aff10ce3098149f97608558ee60ed2c325b947337ae'
            '583b289b46c51bf32bb9e5cfc8e72720408b80a826089b8fc8639f5a61ea395d'
            '5027cdac94de3df7e546c154b9778990ff5f0282e6165296a452a7a8861a6eec'
            '7c5966f4c5513433643a773fd6557fbef0371ff6b09cd7844e0cb3786f27ea42'
            '10dfc44b46d1c213c8c789f6f84c873be9676ae298951d7f682b2664a1e74265'
            '09ac5e673d1ba548e3e886ecc3ac096b066e80cef693e3866774d84d20d46fac'
            '1af4e55c571b3225c752b8e92be938693ce0d26ad05f7ce3f521af2378bdaa59'
            '1683a9cba49df1d61318a29696400205b8196f777633c1b9ce1b07e872a61c73'
            'd57e9a2517fc9682dfe51dee1c8922248e79851e9b5f06e63c3cd7abb38a2133'
            '05cd9da9d8f82232ea188748c8637000601901e3da1d4eeceeec0648dca5b027'
            '5b0fdbae145b09673bcbbff33983449c4bb0909b93670b4fd9d00385d4ab8b10'
            '92726a74f9465f209a24befe9e293866054db396738ea5c84d66128aebe9c636'
            'c60664ea1ffac77a3b37bd074364e732c855f39584d46441ca2730de27d4ac4f'
            'f4ea37f80ecc68f35195c27511e465cd6973ff9d6d85061c2c0be2d627e8e76f'
            'a0b0ded3809695a0e8d4c796bd52683ac705004e1dfa557a2bfb0a55fb6816a6'
            '5a56901050b6e22107a4a3b1323c25c7aa82285228593b6d68886b084bbe04e3'
            '196758373fe187e7b6845243dec01396558b5b9c979926bdd31565579855fc3b'
            'a01a232f35b5ff91cc2834f4a7652a4882a9d31f43adef1ecf1057a6750877ff'
            '8eb8f3c5ee83f5c87ea70f23ec1296d4f388cfde5fe2644c61cf411682f633e1'
            'ce55f749043312556ef3c655dfa7dd3ea7960e2c39842b1f3585de414dd288af'
            '664c11d1f35feb5ac308c87c7c047988a0be7eb914ca4c1296615d3c13ac92db'
            '5ca390aa251ad842a814ba00a9f240940dfd62ec958585c52214478f48b2d410'
            'af5d01672bb7d43f6590c64254be37f638fa7525745a06d77a52336298c5867c'
            'f337e0a79798ade8880c9abe537f72bca4a39d4f30063c68071f96aafa94cfa2'
            'ce67dc8011f09583199170f6b34081a7623dbad190e0cf81232a665d3cca0f69'
            '6c91c8ae5dbc06068a90cdf07c27481951fffd47bb18c81efab1aa8e7d228e71'
            'e9e567c544052aeecb3ae4a0355c5fcc00a783d31b01c145c0fbef03094ebe46'
            '659cd953c3e6f38bb339b16782fdfcf40a1f68e16c7b40e55d41236c694a7b08'
            'e73320f183e637fa41ae8dd9ab24a5f85b6987e66a8b3aed415524f8b909777e'
            '7695ad021e9022f7cae48f427d99badd4cb9246019c812f72007fe0d44489163'
            '8aa0180f7b10bfbbc1f04bffc0d38029f0d8df4e3d4f0beda1aa45aeaeed0dff'
            '15baf53bb6a1a5f7d93ccc34473dd106edfc009bc36dac7ed14aec06a6997312'
            '5a9c54cd2c5a2185bfa1cf10e48875e0ef90c4bb1b04987ae956dd34c17b73f1'
            '0f7d344030aa3240242ea07191351cf69460e84333d5b2733227ecdf2bb3f231'
            '1dd6dcd056a3a932c6e6d57fe738ff9a945de77443bf511b7f42f0eef20b6bf1'
            'fe71d298c8052448a6c89c03619acdca0ac84f6b928152d06be295336eb198dc'
            'd171621a7f276a21b83179bc2028af962222f35879058fc683bbbce292d4a8bd'
            '8529a56ab916d31e04422f47cd14caa92ec74fb9408098966cffdf81a66712e4'
            '77aaf7daafb54b175baaa2fd8d12ae76fb6befd30c7f1b5d058be3a251317fb0'
            'cbc565f6516c882cafb17df21d76de4dcec443262f8584bf60579f249ad24d5c'
            '91906627d93b759c5d0438ca05881ef500753e566d1857eadbf02b47c8f41e82'
            '087bbb08443cb0b4e70600c3be970a8efc5fcb1d039e66e5747678c3b2ca23c4'
            'f8745f33298e05ecad9729c05dc7e16b80865618970ce84ff99f2a0b9aafb3ae'
            'fa34309ae4388f5c87626e5f509601ba876964eb248de32a393c6143816ea8ff'
            '01ecb1bb89ec9af9ed95122a3345ba233b39bd3c671c9657ead0c4d4a8b99baa'
            '5d0caffe3b74ac01cb961392b94f8706333c843b8a7c122a289c9ebf83db1824'
            'c8300fd9f9b9de7b6313194615f7e3b44b34d50cfaf547667689560f8c925ad5'
            '43ca49156387d65f08b4f7e7b43316565f8c2c010c09c42aae566c19269daf82'
            'd043e36ed7cc92c38a18a09282e79a15a6f131e744e9407ab3266b76e5f4ac0b'
            '2a2949052ce5725a015cbbd0e9ece822566f4d090c0b5234bd81ec4d079ec37c'
            '5a3477e01af9d9636e606a04d0b8b97093e3eadf62bebbd421ad6fb7b834195f'
            '92a95489191b6d483446a346e2b8043cd74721d4e466816ebc0e69765238f871'
            '328c98bb34332bf3c4aa472842e0d243178820da29f55741f93c6cecff8e68e7'
            'a86c65d61cb6ef9501adbad9810de6e3ebbd42fc3a179140a147e26f8b60b385'
            '5c7069f500ff2bd86a9f3b801c86dd36832eee011007101032b79e2bb626b7fd'
            'a5c8e1d6c2059972d1bcfc57f4fe66e25cfbd88523ddf55951098afbbea71159'
            'e1ddd6b1dfea3ac6dca6356dbe2ccc73625590e933f53825343f92b777782e15'
            'a9aacef5450e9c6b98fe99161db99333429ca1ef43542f8b7b59bd8a66bdc572'
            '8e645129aeb93f99c0a57afe90dc4d921070ed07ade6d075ce29b320414fcf15'
            'e1a90578c0cdfb21ae3945d4f0bc8b405bece9d69abd561cbdcb6fc4df0b3fe1'
            '4e7136c60d2243ff2d21c5acef7aa0a6205efdcb098001556c6d4b23a6fba4e0'
            '98394b7414fadd93d5cf5886de3568da5065fbe06d5fdfe25f294b37d9500d68'
            'fc7634f79da8e04ff424f53b355fac903e08f39ad3f4bd5bba37b85af6cc22a3'
            '2daefdf42e4f35a36390f626db242099c68e512d1b447f1aa8c48de759f8e974'
            '3abc7da58f9d3dd58bb0a4947a5bac2fa6c563e50e13a1355ac39ba29fafc23e'
            'ed0d3731290cce41e5b7a1d467898938f5d1cd82654c6a121c658d323f5b7875'
            '357765cf139d2aa8766fd513a9a4b481ad4074c98f5b8fd04b8b514e2e0b3668'
            'de600ba74df489a42ecbe6ffe95ad32c2d12cbf41f200a2d98b1e655d6f38c9f'
            '0e36632f805a7def32834273977217c8127c7372965404921cf5d0959dbe44df'
            '8d5b422cb497a3fc890e648823525f51ab32d50c989b5db73945d643250f6106')
